home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK2.toast / Development Kits (Disc 2) / QuickDraw GX / Programming Stuff / Sample Code / Printing Samples / Printer Drivers… / HPXL / ChooserSupport.r < prev    next >
Encoding:
Text File  |  1995-04-10  |  6.2 KB  |  246 lines  |  [TEXT/MPS ]

  1. /*
  2.     ChooserSupport.r - other resources needed in order for driver to work
  3.         with the Chooser.
  4.     
  5.     Copyright © 1993-1994 Apple Computer, Inc.
  6.     All rights reserved.
  7.     
  8.     12/20/93        dmh        Sync'd up for GX 1.0b3.
  9.      8/28/94        dmh        Sync'd up for GX 1.0.1.
  10. */
  11.  
  12. // System 7.0 Compatible
  13. #define SystemSevenOrLater        1
  14.  
  15. #include "Types.r"
  16. #include "SysTypes.r"
  17. #include "PrintingResTypes.r"
  18.  
  19. // what type of communication does this device use (this is the default, as the actual
  20. // value can be found in the desktop printer).
  21. resource 'look' (-4096, sysheap, purgeable) {
  22.     1,                // use the second in our list by default
  23.     
  24.     {
  25.     "Serial",        -4096,        iconCells,                        "Modem Port";
  26.     "Servers",        -4094,        isAppleTalk+isPrinterShare,        "HPXLShared";
  27.     };
  28. };
  29.  
  30. /* ===== 'comm' - specifies the printer shared settings for device ===== */
  31.  
  32. resource 'comm' (-4094, sysheap, purgeable) {
  33.     PrinterShare
  34.         {
  35.         "",
  36.         0
  37.         };
  38. };
  39.  
  40. /* ===== 'comm' - specifies the default communication settings for device ===== */
  41.  
  42. resource 'comm' (-4096, sysheap, purgeable)        // Normally the 'comm' resource used is in the desktop printer
  43. {
  44.     Serial
  45.     {
  46.         baud9600,            // Output baud rate
  47.         noParity,            // Output parity
  48.         oneStop,                // Output stop bits
  49.         data8,                // Output data size
  50.         0x00010000,            // Output handshaking
  51.         0x00000000,
  52.         baud9600,            // Input baud rate
  53.         noParity,            // Input parity
  54.         oneStop,                // Input stop bits
  55.         data8,                // Input data bits
  56.         0,                        // Input handshaking
  57.         0,
  58.         1024,                    // Input buffer size
  59.         ".AIn",                // Input driver name
  60.         ".AOut"                // Output driver name
  61.     }    
  62. };
  63.  
  64.  
  65.  
  66.  
  67.  
  68. /*********************************************************************************************
  69.     STANDARD CHOOSER PACK STUFF
  70. *********************************************************************************************/
  71.  
  72. // NBP Lookup type (maxed out so resource file won't need updating)
  73. resource 'STR ' (-4096, sysheap, purgeable)
  74. {
  75.     "XXXXXXXXXXXXXXXXXXXXXX";
  76. };
  77.  
  78. // NBP timeout value
  79. type 'GNRL'
  80. {
  81.     byte;    // timeout
  82.     byte;    // retries
  83. };
  84.  
  85. resource 'GNRL' (-4096, sysheap, purgeable)
  86. {
  87.     11,
  88.     5
  89. };
  90.  
  91. // title string (we'll put a control here, so we don't want a title)
  92. resource 'STR ' (-4091, sysheap, purgeable)
  93. {
  94.     "";
  95. };
  96.  
  97. // "left" button title
  98. resource 'STR ' (-4093, sysheap, purgeable)
  99. {
  100.     "Create";
  101. };
  102.  
  103. // rectangle list
  104. resource 'nrct' (-4096, sysheap, purgeable) {
  105.     {
  106.     {112, 251, 132, 311};            // left button
  107.     {0,0,0,0};                            // right button
  108.     {-101, 180, -101+20, 400};        // on button (location of device list - popup is placed here)
  109.     {0,0,0,0};                            // off button
  110.     {0,0,0,0};                            // button label
  111.     };
  112. };
  113.  
  114. // Menu used to select between direct connect, AppleTalk, and Servers
  115. resource 'MENU' (-4096, sysheap, purgeable)
  116. {
  117.     -4096,
  118.     textMenuProc,
  119.     0xFFFFFFFF,    
  120.     enabled,
  121.     "",
  122.     {
  123.     }
  124. };
  125.  
  126. // Pop-up control used to select between direct connect printers and those being shared on the network
  127. resource 'CNTL' (-4096, sysheap, purgeable)
  128. {
  129.     {0, 0, 20, 213},                            // zero based control location
  130.     0,                                                // Title options 0 = Left justified
  131.     visible,                                        // Should we display the control?
  132.     95,                                            // Title Width
  133.     -4096,                                        // 'MENU' to display
  134.     popupMenuCDEFproc+popupFixedWidth,    // CDEF = CDEFID * 16 + varCode
  135.     0,                                             // refCon = ResType to append = None
  136.     "Connect via:"                                // Control title
  137. };
  138.  
  139. resource 'DITL' (-4096, sysheap, purgeable) 
  140. {
  141.     {
  142.         {3, 238, 23, 238 + 213}, 
  143.             Control {enabled, -4096},
  144.     };
  145. };
  146.  
  147.  
  148. resource 'DITL' (-4095, sysheap, purgeable) {
  149.     {    /* array DITLarray: 2 elements */
  150.         /* [1] */
  151.         {143, 310, 163, 368},
  152.         Button {
  153.             enabled,
  154.             "OK"
  155.         },
  156.         /* [2] */
  157.         {23, 87, 119, 377},
  158.         StaticText {
  159.             disabled,
  160.             "This printer driver could not be used.\n\n"
  161.             "Quitting one or more applications and then "
  162.             "trying again may allow you to use this "
  163.             "printer driver."
  164.         }
  165.     }
  166. };
  167.  
  168. resource 'ALRT' (-4095, sysheap, purgeable) {
  169.     {38, 30, 231, 456},
  170.     -4095,
  171.     {    /* array: 4 elements */
  172.         /* [1] */
  173.         OK, visible, sound1,
  174.         /* [2] */
  175.         OK, visible, sound1,
  176.         /* [3] */
  177.         OK, visible, sound1,
  178.         /* [4] */
  179.         OK, visible, sound1
  180.     },
  181.     alertPositionParentWindowScreen
  182. };
  183.  
  184. //-----------------------------------------------------------------------------------
  185. // CHOOSER PACK HELP RESOURCES
  186. //-----------------------------------------------------------------------------------
  187.  
  188.  
  189. /*    Any Chooser package can get balloons on all items that are normally 
  190.     added to the Chooser dialog by containing a STR# resource of 
  191.     resource ID = PackResID (-5694) and following the convention below:
  192.         
  193.         resource 'STR#' (-5694, sysheap, purgeable) {
  194.           {        "kEnabledLeftButton";    // message for button (or control) that is Enabled but not checked
  195.                 "kDisabledLeftButton";    // message for the control that is Disabled
  196.                 "kCheckedLeftButton";    // message for the control that is Checked (ie CtrlValue>0)
  197.                 "kOtherLeftButton";        // message for the control that is Other (ie CtrlValue>1)
  198.                 "kEnabledRightButton";
  199.                 "kDisabledRightButton";
  200.                 "kCheckedRightButton";
  201.                 "kOtherRightButton";
  202.                 "kEnabledOnButton";
  203.                 "kDisabledOnButton";
  204.                 "kCheckedOnButton";
  205.                 "kOtherOnButton";
  206.                 "kEnabledOffButton";
  207.                 "kDisabledOffButton";
  208.                 "kCheckedOffButton";
  209.                 "kOtherOffButton";
  210.                 "kEnabledOnOffTitle";
  211.                 "kDisabledOnOffTitle";
  212.                 "kCheckedOnOffTitle";
  213.                 "kOtherOnOffTitle";
  214.           }
  215.         };
  216.         
  217.     This is a horrible Chooser hack for 7.0 - but we'll follow along in GX.
  218. */
  219.  
  220. resource 'STR#' (-5694, sysheap, purgeable) {
  221.   {        
  222.   
  223.           "Click here to create a desktop printer for the selected device."; // message for button (or control) that is Enabled but not checked
  224.         "You have not selected a device to create, or there is not enough memory to create a desktop printer at this time.";    // message for the control that is Disabled
  225.         "";    // message for the control that is Checked (ie CtrlValue>0)
  226.         "";    // message for the control that is Other (ie CtrlValue>1)
  227.         "";    // kEnabledRightButton
  228.         "";    // kDisabledRightButton
  229.         "";    // kCheckedRightButton
  230.         "";    // kOtherRightButton
  231.         "Use this pop–up menu to select the type of connection for the desktop printer you are creating.";
  232.         "";    // kDisabledOnButton
  233.         "";    // kCheckedOnButton 
  234.         "";    // kOtherOnButton
  235.         "";    // kEnabledOffButton
  236.         "";    // kDisabledOffButton
  237.         "";    // kCheckedOffButton
  238.         "";    // kOtherOffButton
  239.         "";    // kEnabledOnOffTitle
  240.         "";    // kDisabledOnOffTitle
  241.         "";    // kCheckedOnOffTitle
  242.         "";    // kOtherOnOffTitle
  243.   }
  244. };
  245.  
  246.